home *** CD-ROM | disk | FTP | other *** search
/ Bride Wars Press Kit / Bride Wars DPK.iso / pc / resources / functions / download.exe / download.dxr / 00003_Flash Commands.ls < prev    next >
Encoding:
Text File  |  2007-02-26  |  1.6 KB  |  78 lines

  1. property pFileName2
  2. global gSavedList, gbPC, myFile, captionPath, captions
  3.  
  4. on startMovie
  5.   myFile = new(xtra("fileio"))
  6. end
  7.  
  8. on stopMovie
  9.   myFile = 0
  10. end
  11.  
  12. on addList me, flashstring
  13.   flashstring2 = convertFile(flashstring)
  14.   gSavedList.add(flashstring2)
  15. end
  16.  
  17. on addTarget me, flashstring
  18.   put flashstring
  19.   member("target").text = flashstring
  20. end
  21.  
  22. on quitProgram
  23.   _player.quit()
  24. end
  25.  
  26. on flashDownload me, flashstring
  27.   if gSavedList.count > 0 then
  28.     if gbPC then
  29.       captionPath = "Documents\"
  30.     else
  31.       captionPath = "Documents:"
  32.     end if
  33.     if not (flashstring = EMPTY) then
  34.       captions = flashstring
  35.     end if
  36.     downloadFiles("DT")
  37.   else
  38.     alert("There are currently no files selected for download!")
  39.     quitProgram()
  40.   end if
  41. end
  42.  
  43. on captionSave
  44.   dtPath = baSysFolder("desktop")
  45.   if dtPath = EMPTY then
  46.     alert("Error finding desktop folder")
  47.     go("exit")
  48.   end if
  49.   destRoot = dtPath & member("target").text.line[1]
  50.   if gbPC then
  51.     destRoot = destRoot & "\"
  52.   else
  53.     destRoot = destRoot & ":"
  54.   end if
  55.   if not baFolderExists(destRoot) then
  56.     res = baCreateFolder(destRoot)
  57.   end if
  58.   destRoot = destRoot & captionPath
  59.   if not baFolderExists(destRoot) then
  60.     res = baCreateFolder(destRoot)
  61.   end if
  62.   if objectp(myFile) then
  63.     myFile = 0
  64.   end if
  65.   mySaveString = captions
  66.   myFile = new(xtra("fileio"))
  67.   dest = destRoot & "Captions.doc"
  68.   filecheck = baFileExists(dest)
  69.   if filecheck = 0 then
  70.     createFile(myFile, dest)
  71.   end if
  72.   openfile(myFile, dest, 0)
  73.   setPosition(myFile, getLength(myFile))
  74.   writeString(myFile, mySaveString)
  75.   closeFile(myFile)
  76.   myFile = 0
  77. end
  78.